package com.sy.config;

import com.sy.utils.MinIOUtils;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @className: MinIOConfig
 * @author: Mr.Liu
 * @date: 2025/11/4 9:13
 * @Version: 1.0
 * @description:
 */
@Configuration
@Data
public class MinIOConfig {

    @Value("${minio.endpoint}")
    private String endpoint;
    @Value("${minio.fileHost}")
    private String fileHost;
    @Value("${minio.bucketName}")
    private String bucketName;
    @Value("${minio.accessKey}")
    private String accessKey;
    @Value("${minio.secretKey}")
    private String secretKey;
    //创建minio客户端
    @Bean
    public MinIOUtils creatMinioClient() {
        return new MinIOUtils(endpoint, fileHost, bucketName, accessKey, secretKey);
    }
}
